﻿using System;
using System.Collections.Generic;
using System.Text;
using designmodule.constructionmodule.AbstractFactory.NormalAbstractFactory;

namespace designmodule.constructionmodule.AbstractFactory.simpleFactory
{
    public class DataAccess
    {
        private readonly string db = "Sqlserver"; //Mysql
        public IUser CreateUser()
        {
            IUser result = null;
            switch (db)
            {
                case "Sqlserver":
                    result = new SqlserverUser();
                    break;
                case "Mysql":
                    result=new MysqlUser();
                    break;
            }

            return result;
        }

        public IDepartment CreateDepartment()
        {
            IDepartment result = null;
            switch (db)
            {
                case "Sqlserver":
                    result = new SqlserverDepartment();
                    break;
                case "Mysql":
                    result = new MysqlDepartment();
                    break;
            }

            return result;
        }
    }
}
